{#
/**
 * @file
 * container
 *
 * See container.wingsuit.yaml for documentation.
 */
#}

{# Defaults #}
{% set width = width|default('default') %}
{% set padding_x = width != 'full' ? padding_x|default('default') : '' %}

{# SETTINGS #}
{% set bg_classes = ([
  pattern_configuration('container', '', 'bg')[bg],
] | sort | join(' ') | trim )%}

{% set classes = ([
  pattern_configuration('container', '', 'padding_x')[padding_x],
  pattern_configuration('container', '', 'padding_top')[padding_top],
  pattern_configuration('container', '', 'padding_bottom')[padding_bottom],
  pattern_configuration('container', '', 'width')[width],
  classes,
  'mx-auto'
] | sort | join(' ') | trim )%}

{% set attributes = attributes|default(create_attribute()) %}

{# TEMPLATE #}
{% if bg %}
<div {{ create_attribute().addClass(bg_classes) }}>
{% endif %}
  <div {{ attributes.addClass(classes) }}>
    {% block content %}
    {{ content }}
    {% endblock %}
  </div>
{% if bg %}
</div>
{% endif %}
